package com.pubinfo.passbook.common.entity;

import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.RandomUtil;
import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.pubinfo.passbook.common.model.bo.witeoff.WiteoffBase;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.util.Date;
import java.util.Random;

/**
 * @TableName t_rule_audit
 */
@TableName(value = "t_rule_audit")
@Data
@NoArgsConstructor
@ApiModel(value = "TRuleAudit", description = "待办事项表")
public class TRuleAudit implements Serializable {
  /**
     */
    @ApiModelProperty("当前审核人")
    private String acct;
    /**
     * 
     */
    @ApiModelProperty("审核状态")
    private Byte status;

    /**
     * 
     */
    @TableField(fill = FieldFill.INSERT)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date createTime;

    /**
     * 
     */
    @TableField(fill = FieldFill.UPDATE)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @ApiModelProperty("审核时间")
    private Date auditTime;

    /**
     * 
     */
    @ApiModelProperty("报账单id")
    private String witeoffid;

    /**
     * 
     */
    @ApiModelProperty("公司所属代码")
    private String nsrsbh;

    /**
     * 
     */
    @TableId(type = IdType.ASSIGN_ID,value = "id")
    private String id;

    /**
     * 
     */
    @ApiModelProperty("审核意见")
    private String detail;

    /**
     *待办标识
     */
    @ApiModelProperty("待办标识")
    private String identification;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;
  
    public TRuleAudit(WiteoffBase jobDTO) {
      this.status = 0;
      this.witeoffid = jobDTO.getOtherSystemMainId();
      this.nsrsbh = jobDTO.getNsrsbh();
      this.identification= DateUtil.format(new Date(),"yyyyMMdd")+"-"+ RandomUtil.randomNumbers(6);
      // this.acct=auditUser;
    }
}